# Created by 黄景涛
# DATE: 2025/2/25
import requests
from 蓝鲸各saas登录方案.V5.saas_login import SmartLogin, InnerLogin
from 蓝鲸各saas登录方案.V5.config.settings import cfg

if __name__ == '__main__':
    login_url = cfg.get('login_url')
    username = cfg.get('username')
    password = cfg.get('password')
    saas_name = cfg.get('smart_saas')
    cookies = SmartLogin(login_url, username, password, saas_name).login()

    esmv40_api = "http://apps.test-bkee5.cwoa.net/cc-auto/login_info"
    response = requests.get(esmv40_api, cookies=cookies, verify=False)
    print(response.json())

    # =================================================================================================
    saas_name = cfg.get('inner_saas')
    cookies = InnerLogin(login_url, username, password, saas_name).login()
    bkuser_api = "http://bkuser.test-bkee5.cwoa.net/api/v1/web/fields/"
    response = requests.get(bkuser_api, cookies=cookies, verify=False)
    print(response.json())
